{template 'header'}
<ul class="nav nav-tabs">
    <li class=""><a href="{php echo $this->createWeburl('navigation')}">导航栏管理</a></li>
    <li class="active"><a href="{php echo $this->createWeburl('navigation', array('op' => 'addShow'));}">添加导航栏</a></li>
</ul>
<form action="" method="post" class="form-horizontal" id="myform" role="form" enctype="multipart/form-data">
    <div class="form-group">
        <label class="col-xs-12 col-sm-3 col-md-1 control-label">导航名字</label>
        <div class="col-sm-7 col-lg-8 col-md-8 col-xs-12">
            <input class="form-control" name="name" placeholder="导航名字" value="{$navigation['name']}" type="text">
        </div>
    </div>
    <div class="form-group">
        <label class="col-xs-12 col-sm-3 col-md-1 control-label">位置</label>
        <div class="col-sm-7 col-lg-8 col-md-8 col-xs-12">
            <select class="select valid" name="position" size="1" aria-invalid="false" style="width: 150px;">
                <option  value="0">请选择</option>
                <option  value="index_home" {if $navigation['position'] == 'index_home'} selected {/if} >首页</option>
                <option  value="goods_category" {if $navigation['position'] == 'goods_category'} selected {/if}>  砍价商城</option>
                <option  value="sign_shop" {if $navigation['position'] == 'sign_shop'} selected {/if}>积分商城</option>
                <option  value="my_index" {if $navigation['position'] == 'my_index'} selected {/if}>我的</option>
                <option  value="sign_index" {if $navigation['position'] == 'sign_index'} selected {/if}>签到任务页</option>
                <option  value="luck_index" {if $navigation['position'] == 'luck_index'} selected {/if}>抽奖列表</option>

            </select>
        </div>
    </div>
    <div class="form-group">
        <label class="col-xs-12 col-sm-3 col-md-1 control-label">小程序路径</label>
        <div class="col-sm-7 col-lg-8 col-md-8 col-xs-12">
            <input class="form-control" name="path" placeholder="小程序路径" value="{$navigation['path']}" type="text">
        </div>
    </div>
    <div class="form-group" id="ling-1">
        <label class="col-xs-12 col-sm-3 col-md-1 control-label">选中时图片:</label>
        <div class="col-sm-7 col-lg-8 col-md-8 col-xs-12">
            {php echo tpl_form_field_image('selection_image', getImage($navigation['selection_image'], true), getImage($navigation['selection_image']));}
            <label class="control-label" style="color: red">大小:80 * 80</label>
        </div>
    </div>
    <div class="form-group">
        <label class="col-xs-12 col-sm-3 col-md-1 control-label">没选中是图片:</label>
        <div class="col-sm-7 col-lg-8 col-md-8 col-xs-12">
            {php echo tpl_form_field_image('unchecked_images', getImage($navigation['unchecked_images'], true), getImage($navigation['unchecked_images']));}
            <label class="control-label" style="color: red">大小:80 * 80</label>
        </div>
    </div>
    <div class="form-group">
        <label class="col-xs-12 col-sm-3 col-md-1 control-label">选中时文字颜色:</label>
        <div class="col-sm-7 col-lg-8 col-md-8 col-xs-12">
            <input class="form-control" style="width: 30%;float: left" id="selection_color" name="selection_color" placeholder="选中时文字颜色" value="{$navigation['selection_color']}" type="text">
            <button id="picker1" class="btn btn-primary" style="margin-left: 10px" type="button">设置颜色</button>
        </div>
    </div>

    <div class="form-group">
        <label class="col-xs-12 col-sm-3 col-md-1 control-label">未选中时文字颜色:</label>
        <div class="col-sm-7 col-lg-8 col-md-8 col-xs-12">
            <input class="form-control" style="width: 30%;float: left" id="unchecked_color" name="unchecked_color" placeholder="未选中时文字颜色" value="{$navigation['unchecked_color']}" type="text">
            <button id="picker2" class="btn btn-primary" style="margin-left: 10px" type="button">设置颜色</button>
        </div>
    </div>


    <div class="form-group">
        <label class="col-xs-12 col-sm-3 col-md-1 control-label">序号</label>
        <div class="col-sm-7 col-lg-8 col-md-8 col-xs-12">
            <input class="form-control" name="sort" placeholder="序号" value="{$navigation['sort']}" type="text">
        </div>
    </div>

    <div class="form-group">
        <label class="col-xs-12 col-sm-3 col-md-1 control-label"></label>
        <div class="" >
            <input type="hidden" name="op" value="{php echo $navigation['id'] ? 'edit' : 'add'}">
            <input type="hidden" name="id" value="{$navigation['id']}">
            <input type="submit" name="submit" id="submit" value="{php echo $navigation['id'] ? '修改' : '添加'}" class="btn btn-primary">
        </div>
    </div>
</form>
<script src="{$siteRoot}addons/bh_rising/template/js/colpick.js" type="text/javascript"></script>
<link rel="stylesheet" href="{$siteRoot}addons/bh_rising/template/js/colpick.css" type="text/css"/>
<script type="application/javascript">
    $('#picker1').colpick({
        submit: false,
        onChange: function (color, color2) {
            jQuery("#selection_color").val('#' + color2);
        }
    });
    $('#picker2').colpick({
        submit: false,
        onChange: function (color, color2) {
            jQuery("#unchecked_color").val('#' + color2);
        }
    });

</script>
{template 'footer'}
